CSP Numba Node - #693
Conversation
d071795 to
3274897
Compare
460d5ee to
965219d
Compare
| @@ -1,9 +1,9 @@ | |||
| EXTRA_ARGS := | |||
| EXTRA_ARGS := --csp-no-vcpkg | |||
ff8809f to
fa75f57
Compare
| # _cspimpl, which would be a circular dep | ||
| spec = importlib.util.find_spec("csp") | ||
| loader = importlib.machinery.SourceFileLoader(spec.name, spec.origin) | ||
| # Use this script's location to find csp package (works for editable installs where spec.origin may be None) |
There was a problem hiding this comment.
what issue is this addressing? I havent had issues building with editable installs
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
fa75f57 to
e3c3a07
Compare
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
952bca6 to
a128253
Compare
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
b3060e2 to
fbbddbe
Compare
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
fbbddbe to
6414320
Compare
Signed-off-by: Mark Halka <Mark.Halka@Point72.com>
| // destination as a raw int64 slot. | ||
| char * bytes = static_cast<char *>( struct_ptr ); | ||
| auto * enumField = reinterpret_cast<CspEnum *>( bytes + field_offset ); | ||
| *enumField = enumField -> meta() -> create( value ); |
There was a problem hiding this comment.
This will dereference null when one tries to set an enum field that wasn't initialized
| func_globals=transformed_globals, | ||
| ) | ||
|
|
||
| if output_names is not None: |
There was a problem hiding this comment.
I'd look into reusing some existing parsing and wiring. The CSPNodeTransformer has handling for special blocks that is already included in the existing NodeParser. Furthermore, if the CSPNodeTransformer could produce a Signature, it could use the existing NodeDefMeta output Edge wiring (by subclassing the Meta to just produce a compiled function and the outputs) rather than rolling its own here. I'd try to create an object that does both special block parsing and signature creation, and share it between the CSPNodeTransformer using in @numba_node and NodeParser used in @node.
| CSP_ASSERT( cspType != nullptr ); | ||
| switch( cspType -> type() ) | ||
| { | ||
| case CspType::Type::INT64: |
There was a problem hiding this comment.
try PartialSwitchCspType::invoke() here and below
| return isinstance(var_type, type) and issubclass(var_type, CspEnum) | ||
|
|
||
| @classmethod | ||
| def from_type(cls, var_type: Any, value: Any) -> Optional["CspEnumType"]: |
There was a problem hiding this comment.
just flagging that from_type and get_methods are the same as on VariableType
| return edge | ||
|
|
||
|
|
||
| class TsInputHandler(InputTypeHandler): |
There was a problem hiding this comment.
Maybe most of this file can be removed with the parsing refactor I mentioned. BaseParser._parse_func_signature should do something like this already
integrate numba_type_utils into CSP and support CSP specific syntax. Note that numba_type_utils must be made public before this can be merged.